//
//  HLHBAlertViewController.m
//  LearningRoad
//
//  Created by Zhl on 2017/9/13.
//  Copyright © 2017年 LearningRoad. All rights reserved.
//

#import "HLHBAlertViewController.h"
#import "HLGetHBAlertView.h"
#import "Info_BBSModel.h"
#import "RedbagBaseModel.h"
@interface HLHBAlertViewController ()<HLGetHBAlertViewDelegate>

@end

@implementation HLHBAlertViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(100, 100, 40, 40);
    [btn setTitle:@"红包" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    [self p_showRedbagAlert];
    // Do any additional setup after loading the view.
}
-(void)p_showRedbagAlert{
    Info_BBSModel *model = [[Info_BBSModel alloc] init];
    model.avatarphoto = @"";
    model.author = @"坐着";
    
    RedbagBaseModel *redBagModel = [[RedbagBaseModel alloc] init];
    redBagModel.errorCode = @"12010";
    [HLGetHBAlertView showHLGetHBAlertViewInWindowWithDelegate:self model:model RedbagModel:redBagModel];
}
-(void)p_removeRedbagAlert{
    [HLGetHBAlertView removeHLGetHBAlertViewFromWindow];
}
-(void)btnClick{
    [self p_showRedbagAlert];
}
/**
 *  Open按钮被点击
 */
-(void)hLGetHBAlertViewOpenBtnClicked{
    
    [self performSelector:@selector(p_removeRedbagAlert) withObject:nil afterDelay:3];
}
/**
 *  查看大家手气按钮被点击
 */
-(void)hLGetHBAlertViewSeeLuckyBtnClicked{

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
